package factorymethod.creator;

import factorymethod.product.Product;

/**
 * description:
 *  创建者
 * @author yuanmenglv on 2019/11/28
 */
public abstract class Creator {
    /**
     * 预定产品
     * @param type  产品类型(A,B,C,D)
     * @return
     */
    public Product orderProduct(String type){
        Product product;
        product = createProduct(type);
        product.prepare();
        product.bake();
        product.cut();
        product.box();
        return product;
    }

    abstract Product createProduct(String type);
}
